package com.jetinno.file

import android.content.Context
import android.widget.EditText
import androidx.recyclerview.widget.DividerItemDecoration
import androidx.recyclerview.widget.LinearLayoutManager
import androidx.recyclerview.widget.RecyclerView
import com.jetinno.simple.SimpleDialog

/**
 * Created by zhangyuncai on 2023/9/21.
 */
class CommonCharDialog(context: Context, private val editText: EditText) : SimpleDialog(context) {

    override fun getLayoutId(): Int {
        return R.layout.dialog_commonchar
    }

    override fun initView() {
        val rv_commonchar = findViewById<RecyclerView>(R.id.rv_commonchar)

        val mDatas: MutableList<String> = ArrayList()
        mDatas.add("NEW")
        mDatas.add("OLD")
        mDatas.add("ON")
        mDatas.add("OFF")
        mDatas.add("TRUE")
        mDatas.add("FALSE")
        mDatas.add("0")
        mDatas.add("1")
        mDatas.add("2")
        mDatas.add("3")
        mDatas.add("-1")
        mDatas.add("true")
        mDatas.add("false")
        mDatas.add("30")
        mDatas.add("300")
        mDatas.add("\"")
        mDatas.add("{")
        mDatas.add("}")
        mDatas.add("[")
        mDatas.add("]")
        mDatas.add(",")
        mDatas.add(":")

        val adapter = CommonCharAdapter(this, mDatas, editText)
        rv_commonchar.layoutManager = LinearLayoutManager(context)
        rv_commonchar.adapter = adapter
        val dividerItemDecoration = DividerItemDecoration(context, DividerItemDecoration.VERTICAL)
        rv_commonchar.addItemDecoration(dividerItemDecoration)
    }

    override fun initEvent() {
    }
}
